package com.zhijian.medical.dao.local;

import com.zhijian.medical.entity.po.AssessmentPaper;
import com.zhijian.medical.entity.vo.request.AssessmentPaperSearchVo;
import com.zhijian.medical.entity.vo.response.AssessmentPaperVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AssessmentPaperMapper {
    int deleteByPrimaryKey(Long id);

    /**
     * 根据考核id进行删除
     *
     * @param assessmentId
     * @return
     */
    int deleteByAssessmentId(Long assessmentId);

    int insert(AssessmentPaper record);

    int insertSelective(AssessmentPaper record);

    AssessmentPaper selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(AssessmentPaper record);

    int updateByPrimaryKey(AssessmentPaper record);

    int count(AssessmentPaperSearchVo assessmentPaperSearchVo);

    List<AssessmentPaperVo> selectList(AssessmentPaperSearchVo assessmentPaperSearchVo);

    AssessmentPaperVo selectVoById(Long id);

    int insertBatch(@Param("entities") List<AssessmentPaper> entities);

    /**
     * 根据人员id与考核id进行查找
     *
     * @param userId
     * @param assessmentId
     * @return
     */
    AssessmentPaper selectByUserIdAndAssessmentId(@Param("userId") Long userId, @Param("assessmentId") Long assessmentId);

    /**
     * 根据考核id进行查找
     *
     * @param assessmentId
     * @return
     */
    AssessmentPaper selectByAssessmentId(Long assessmentId);

    /**
     * 查询某次考核，合格的人员的总数
     *
     * @param assessmentId
     * @return
     */
    Integer countUpByAssessmentId(Long assessmentId);
}